package model

type SystemConfigurationStatus int

const (
	SystemConfigurationStatusDisabled = SystemConfigurationStatus(1) // 禁用
	SystemConfigurationStatusEnabled  = SystemConfigurationStatus(2) // 启用
)

//go:generate go run ../cmd/generate dao --table system_configurations

type SystemConfiguration struct {
	Model

	Key         *string                    `gorm:"type:string;size:255;not null"`  // 配置键
	Val         *string                    `gorm:"type:string;size:2000;not null"` // 配置值
	Status      *SystemConfigurationStatus `gorm:"type:uint;not null;default:1"`   // 状态
	EffectTime  *int64                     `gorm:"type:uint;not null;default:0"`   // 生效时间
	ExpiredTime *int64                     `gorm:"type:uint;not null;default:0"`   // 过期时间
}

func (cls *SystemConfiguration) TableName() string {
	return "system_configurations"
}
